package com.vast.vastlcd.preferences;


import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;

import com.vast.vastlcd.Activator;


/**
 * Class used to initialize default preference values.
 */
public class PreferenceInitializer extends AbstractPreferenceInitializer {

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
	 */
	public void initializeDefaultPreferences() {
		IPreferenceStore store = Activator.getDefault()
				.getPreferenceStore();
		store.setDefault(PreferenceConstants.P_TRIGGERS, "VastGpLcdController");
		store.setDefault(PreferenceConstants.P_INTERFACE_TYPE, "Socket");
		store.setDefault(PreferenceConstants.P_SERVER_OR_CLIENT_TYPE, "Server");
		store.setDefault(PreferenceConstants.P_SOCKET_PORTNUMBER,7625);
		store.setDefault(PreferenceConstants.P_SOCKET_HOSTNAME,"127.0.0.1");
		
		if (System.getProperty("osgi.ws").indexOf("win")>=0) {
			store.setDefault(PreferenceConstants.P_PIPENAME, "\\\\.\\PIPE\\vastlcd");
		} else {
			store.setDefault(PreferenceConstants.P_PIPENAME, "/tmp/vastlcd");
		}
	}
}
